<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Embroidermodder: extern/libembroidery/src/fill.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  extensions: ["tex2jax.js", "TeX/AMSmath.js"],
  jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="logo_embroidermodder_2_0.png"/></td>
  <td id="projectalign">
   <div id="projectname">Embroidermodder<span id="projectnumber">&#160;2.0.0-alpha4</span>
   </div>
   <div id="projectbrief">A free and open source software for machine embroidery</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('fill_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle"><div class="title">fill.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
<code>#include &quot;<a class="el" href="embroidery__internal_8h_source.html">embroidery_internal.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af27a83a237ef6302cbfb5af534229e10"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#af27a83a237ef6302cbfb5af534229e10">lindenmayer_system</a> (<a class="el" href="embroidery_8h.html#a914404401c03a6bf0dac814661ba370c">L_system</a> L, char *state, int iterations, int complete)</td></tr>
<tr class="separator:af27a83a237ef6302cbfb5af534229e10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fd47c53d468e3e5590e096495acac79"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a0fd47c53d468e3e5590e096495acac79">join_short_stitches</a> (int *points, int *n_points, int width, int tolerence)</td></tr>
<tr class="separator:a0fd47c53d468e3e5590e096495acac79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc8683886c723530102d2b75f14b6dbd"><td class="memItemLeft" align="right" valign="top">static int *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#adc8683886c723530102d2b75f14b6dbd">threshold_method</a> (<a class="el" href="embroidery_8h.html#a907d23c2268eff84b7c5146b2add1bb4">EmbImage</a> *image, int *n_points, int subsample_width, int subsample_height, int threshold)</td></tr>
<tr class="separator:adc8683886c723530102d2b75f14b6dbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d43a4168ef00fcb9221321b4508c8c5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a5d43a4168ef00fcb9221321b4508c8c5">greedy_algorithm</a> (int *points, int n_points, int width, <a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> bias)</td></tr>
<tr class="separator:a5d43a4168ef00fcb9221321b4508c8c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af65a5f7a682322a9588066dfc9d3e10d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#af65a5f7a682322a9588066dfc9d3e10d">save_points_to_pattern</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *pattern, int *points, int n_points, <a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a> scale, int width, int height)</td></tr>
<tr class="separator:af65a5f7a682322a9588066dfc9d3e10d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51526002a19f07437ee07f4c6d475690"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a51526002a19f07437ee07f4c6d475690">embPattern_horizontal_fill</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *pattern, <a class="el" href="embroidery_8h.html#a907d23c2268eff84b7c5146b2add1bb4">EmbImage</a> *image, int threshhold)</td></tr>
<tr class="separator:a51526002a19f07437ee07f4c6d475690"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadaaf644936dbeeb4286a00c4fe04794"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#aadaaf644936dbeeb4286a00c4fe04794">embPattern_crossstitch</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *pattern, <a class="el" href="embroidery_8h.html#a907d23c2268eff84b7c5146b2add1bb4">EmbImage</a> *image, int threshhold)</td></tr>
<tr class="separator:aadaaf644936dbeeb4286a00c4fe04794"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f0cd5118998e9310252de0bd11c6fb2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a2f0cd5118998e9310252de0bd11c6fb2">hilbert_curve</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *pattern, int iterations)</td></tr>
<tr class="separator:a2f0cd5118998e9310252de0bd11c6fb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad02b5d945eacff708d2bf084c40044d8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#ad02b5d945eacff708d2bf084c40044d8">generate_dragon_curve</a> (char *state, int iterations)</td></tr>
<tr class="separator:ad02b5d945eacff708d2bf084c40044d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f15f9548d56044f41aa91dd103c3914"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a9f15f9548d56044f41aa91dd103c3914">dragon_curve</a> (int iterations)</td></tr>
<tr class="separator:a9f15f9548d56044f41aa91dd103c3914"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accb8d958755abb87ae8fe5cb64241c5b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#accb8d958755abb87ae8fe5cb64241c5b">embPolygon_reduceByDistance</a> (<a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *vertices, <a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *simplified, float distance)</td></tr>
<tr class="separator:accb8d958755abb87ae8fe5cb64241c5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa25158aa39b36f6981756295d6601910"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#aa25158aa39b36f6981756295d6601910">embPolygon_reduceByNth</a> (<a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *vertices, <a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *out, int nth)</td></tr>
<tr class="separator:aa25158aa39b36f6981756295d6601910"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa629adadc7956aab2bfd8b0de7ccdd54"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#aa629adadc7956aab2bfd8b0de7ccdd54">embPattern_combine</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p1, <a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p2)</td></tr>
<tr class="separator:aa629adadc7956aab2bfd8b0de7ccdd54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e048d8296a5178c1188ca70ee2256e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a8e048d8296a5178c1188ca70ee2256e7">embPattern_stitchArc</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#a09945e6e919629c5787e61582c712ba1">EmbArc</a> arc, int thread_index, int style)</td></tr>
<tr class="separator:a8e048d8296a5178c1188ca70ee2256e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4927287166f2a0abbc7b482ff4054a5e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a4927287166f2a0abbc7b482ff4054a5e">embPattern_stitchCircle</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#a87fc13ccd4dbaa7de7c85efde17bba0e">EmbCircle</a> circle, int thread_index, int style)</td></tr>
<tr class="separator:a4927287166f2a0abbc7b482ff4054a5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63bc84e4406e59c092a2e076afedf930"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a63bc84e4406e59c092a2e076afedf930">embPattern_stitchEllipse</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#a4e48ebde5bd4d82b875f98b347bdd62c">EmbEllipse</a> ellipse, int thread_index, int style)</td></tr>
<tr class="separator:a63bc84e4406e59c092a2e076afedf930"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a736fce5df010bbe74ea9ad2857be9bf4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a736fce5df010bbe74ea9ad2857be9bf4">embPattern_stitchPath</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#af29045dfeebafdcb66d114b390c4a686">EmbPath</a> path, int thread_index, int style)</td></tr>
<tr class="separator:a736fce5df010bbe74ea9ad2857be9bf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86f903495c0da7514294200680bd6414"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a86f903495c0da7514294200680bd6414">embPattern_stitchPolygon</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#a2d6988a5f4ba24d26c7eff65dbc9d029">EmbPolygon</a> polygon, int thread_index, int style)</td></tr>
<tr class="separator:a86f903495c0da7514294200680bd6414"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ae9d5d7dfbb2ab361dc37970b7eb2f2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a9ae9d5d7dfbb2ab361dc37970b7eb2f2">embPattern_stitchPolyline</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#ab5563c868d8f8174d5be764808a647dd">EmbPolyline</a> polyline, int thread_index, int style)</td></tr>
<tr class="separator:a9ae9d5d7dfbb2ab361dc37970b7eb2f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae38ddde615726bba5070a6b17ce6d018"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#ae38ddde615726bba5070a6b17ce6d018">embPattern_stitchRect</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#ac2f33b151fc40a0da3b14379aa0ec653">EmbRect</a> rect, int thread_index, int style)</td></tr>
<tr class="separator:ae38ddde615726bba5070a6b17ce6d018"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a908f6c41318183bcfceebdd9b646dc90"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a908f6c41318183bcfceebdd9b646dc90">embPattern_stitchText</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p, <a class="el" href="embroidery_8h.html#ac2f33b151fc40a0da3b14379aa0ec653">EmbRect</a> rect, int thread_index, int style)</td></tr>
<tr class="separator:a908f6c41318183bcfceebdd9b646dc90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad948b1ae6e42c31b1a020348bedddfab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#ad948b1ae6e42c31b1a020348bedddfab">embPattern_convertGeometry</a> (<a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *p)</td></tr>
<tr class="separator:ad948b1ae6e42c31b1a020348bedddfab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:add6424b0861a4e44ac11fc4cbf99d1d1"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#add6424b0861a4e44ac11fc4cbf99d1d1">rules</a> [] = {&quot;+BF-AFA-FB+&quot;, &quot;-AF+BFB+FA-&quot;}</td></tr>
<tr class="separator:add6424b0861a4e44ac11fc4cbf99d1d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e10b231de6baafee918b26f004d7327"><td class="memItemLeft" align="right" valign="top"><a class="el" href="embroidery_8h.html#a914404401c03a6bf0dac814661ba370c">L_system</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fill_8c.html#a6e10b231de6baafee918b26f004d7327">hilbert_curve_l_system</a></td></tr>
<tr class="separator:a6e10b231de6baafee918b26f004d7327"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a9f15f9548d56044f41aa91dd103c3914" name="a9f15f9548d56044f41aa91dd103c3914"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f15f9548d56044f41aa91dd103c3914">&#9670;&nbsp;</a></span>dragon_curve()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int dragon_curve </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>iterations</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Create the dragon curve for <em>iterations</em>.</p>
<p >Returns 0 if the number of iterations is greater than 10 and 1 otherwise. </p>

</div>
</div>
<a id="aa629adadc7956aab2bfd8b0de7ccdd54" name="aa629adadc7956aab2bfd8b0de7ccdd54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa629adadc7956aab2bfd8b0de7ccdd54">&#9670;&nbsp;</a></span>embPattern_combine()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> * embPattern_combine </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p1</em> <em>p2</em> </p><dl class="section return"><dt>Returns</dt><dd>EmbPattern* </dd></dl>

</div>
</div>
<a id="ad948b1ae6e42c31b1a020348bedddfab" name="ad948b1ae6e42c31b1a020348bedddfab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad948b1ae6e42c31b1a020348bedddfab">&#9670;&nbsp;</a></span>embPattern_convertGeometry()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_convertGeometry </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> </p>

</div>
</div>
<a id="aadaaf644936dbeeb4286a00c4fe04794" name="aadaaf644936dbeeb4286a00c4fe04794"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aadaaf644936dbeeb4286a00c4fe04794">&#9670;&nbsp;</a></span>embPattern_crossstitch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_crossstitch </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a907d23c2268eff84b7c5146b2add1bb4">EmbImage</a> *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>threshhold</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>pattern</em> <em>image</em> <em>threshhold</em> </p>
<p >Uses a threshhold method to determine where to put crosses in the fill.</p>
<p >To improve this, we can remove the vertical stitches when two crosses neighbour. Currently the simple way to do this is to chain crosses that are neighbours exactly one ahead. </p>

</div>
</div>
<a id="a51526002a19f07437ee07f4c6d475690" name="a51526002a19f07437ee07f4c6d475690"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51526002a19f07437ee07f4c6d475690">&#9670;&nbsp;</a></span>embPattern_horizontal_fill()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_horizontal_fill </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a907d23c2268eff84b7c5146b2add1bb4">EmbImage</a> *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>threshhold</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>pattern</em> <em>image</em> <em>threshhold</em> </p>
<p >Uses a threshhold method to determine where to put lines in the fill.</p>
<p >Needs to pass a "donut test", i.e. an image with black pixels where: 10 &lt; x*x + y*y &lt; 20 over the area (-30, 30) x (-30, 30).</p>
<p >Use render then image difference to see how well it passes. </p>

</div>
</div>
<a id="a8e048d8296a5178c1188ca70ee2256e7" name="a8e048d8296a5178c1188ca70ee2256e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8e048d8296a5178c1188ca70ee2256e7">&#9670;&nbsp;</a></span>embPattern_stitchArc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchArc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a09945e6e919629c5787e61582c712ba1">EmbArc</a>&#160;</td>
          <td class="paramname"><em>arc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>arc</em> <em>thread_index</em> <em>style</em> </p>

</div>
</div>
<a id="a4927287166f2a0abbc7b482ff4054a5e" name="a4927287166f2a0abbc7b482ff4054a5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4927287166f2a0abbc7b482ff4054a5e">&#9670;&nbsp;</a></span>embPattern_stitchCircle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchCircle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a87fc13ccd4dbaa7de7c85efde17bba0e">EmbCircle</a>&#160;</td>
          <td class="paramname"><em>circle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>circle</em> <em>thread_index</em> <em>style</em> </p>
<p >style determines: stitch density fill pattern outline or fill</p>
<p >For now it's a straight fill of 1000 stitches of the whole object by default.</p>
<p >Consider the intersection of a line in direction "d" that passes through the disc with center "c", radius "r". The start and end points are: </p><pre class="fragment">$(c-r(d/|d|), c + r(d/|d|))$
</pre><p> Lines that are above and below this with an even seperation $s$ can be found by taking the point on the line to be c+sn where the $n$ is the unit normal vector to $d$ and the vector to be $d$ again. The intersection points are therefore a right angled triangle, with one side r, another s and the third the length to be solved, by Pythagoras we have:</p>
<p >$(c + sn - \sqrt{r^2-s^2}(d/|d|), c + sn + \sqrt{r^2-s^2}(d/|d|))$</p>
<p >repeating this process gives us all the end points and the fill only alters these lines by splitting the ones longer than some tolerence. </p>

</div>
</div>
<a id="a63bc84e4406e59c092a2e076afedf930" name="a63bc84e4406e59c092a2e076afedf930"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63bc84e4406e59c092a2e076afedf930">&#9670;&nbsp;</a></span>embPattern_stitchEllipse()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchEllipse </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a4e48ebde5bd4d82b875f98b347bdd62c">EmbEllipse</a>&#160;</td>
          <td class="paramname"><em>ellipse</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>ellipse</em> <em>thread_index</em> <em>style</em> </p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000221">Todo:</a></b></dt><dd>finish stitchEllipse </dd></dl>

</div>
</div>
<a id="a736fce5df010bbe74ea9ad2857be9bf4" name="a736fce5df010bbe74ea9ad2857be9bf4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a736fce5df010bbe74ea9ad2857be9bf4">&#9670;&nbsp;</a></span>embPattern_stitchPath()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchPath </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#af29045dfeebafdcb66d114b390c4a686">EmbPath</a>&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>rect</em> <em>thread_index</em> <em>style</em> </p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000222">Todo:</a></b></dt><dd>finish stitch path </dd></dl>

</div>
</div>
<a id="a86f903495c0da7514294200680bd6414" name="a86f903495c0da7514294200680bd6414"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86f903495c0da7514294200680bd6414">&#9670;&nbsp;</a></span>embPattern_stitchPolygon()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchPolygon </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a2d6988a5f4ba24d26c7eff65dbc9d029">EmbPolygon</a>&#160;</td>
          <td class="paramname"><em>polygon</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>rect</em> <em>thread_index</em> <em>style</em> </p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000223">Todo:</a></b></dt><dd>finish stitch polygon </dd></dl>

</div>
</div>
<a id="a9ae9d5d7dfbb2ab361dc37970b7eb2f2" name="a9ae9d5d7dfbb2ab361dc37970b7eb2f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ae9d5d7dfbb2ab361dc37970b7eb2f2">&#9670;&nbsp;</a></span>embPattern_stitchPolyline()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchPolyline </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#ab5563c868d8f8174d5be764808a647dd">EmbPolyline</a>&#160;</td>
          <td class="paramname"><em>polyline</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>rect</em> <em>thread_index</em> <em>style</em> </p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000224">Todo:</a></b></dt><dd>finish stitch polyline </dd></dl>

</div>
</div>
<a id="ae38ddde615726bba5070a6b17ce6d018" name="ae38ddde615726bba5070a6b17ce6d018"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae38ddde615726bba5070a6b17ce6d018">&#9670;&nbsp;</a></span>embPattern_stitchRect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchRect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#ac2f33b151fc40a0da3b14379aa0ec653">EmbRect</a>&#160;</td>
          <td class="paramname"><em>rect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>rect</em> <em>thread_index</em> <em>style</em> </p>
<p >Here we just stitch the rectangle in the direction of it's longer side. </p>

</div>
</div>
<a id="a908f6c41318183bcfceebdd9b646dc90" name="a908f6c41318183bcfceebdd9b646dc90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a908f6c41318183bcfceebdd9b646dc90">&#9670;&nbsp;</a></span>embPattern_stitchText()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPattern_stitchText </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#ac2f33b151fc40a0da3b14379aa0ec653">EmbRect</a>&#160;</td>
          <td class="paramname"><em>rect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>thread_index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>style</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>p</em> <em>rect</em> <em>thread_index</em> <em>style</em> </p>

</div>
</div>
<a id="accb8d958755abb87ae8fe5cb64241c5b" name="accb8d958755abb87ae8fe5cb64241c5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#accb8d958755abb87ae8fe5cb64241c5b">&#9670;&nbsp;</a></span>embPolygon_reduceByDistance()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPolygon_reduceByDistance </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *&#160;</td>
          <td class="paramname"><em>vertices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *&#160;</td>
          <td class="paramname"><em>simplified</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>distance</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>vertices</em> <em>simplified</em> <em>distance</em> </p>
<p >Reduces the polygon by distance.</p>
<p >This is a non-destructive function, so the caller is responsible for freeing "vertices" if they choose to keep "simplified". </p>

</div>
</div>
<a id="aa25158aa39b36f6981756295d6601910" name="aa25158aa39b36f6981756295d6601910"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa25158aa39b36f6981756295d6601910">&#9670;&nbsp;</a></span>embPolygon_reduceByNth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void embPolygon_reduceByNth </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *&#160;</td>
          <td class="paramname"><em>vertices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#aebe8b1561a59d167cfe6613863a671ca">EmbArray</a> *&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>vertices</em> <em>out</em> <em>nth</em> </p>
<p >Reduces the polygon by removing the Nth vertex in the vertices list. This is a non-destructive function, so the caller is responsible for freeing vertices if they choose to keep out. </p>

</div>
</div>
<a id="ad02b5d945eacff708d2bf084c40044d8" name="ad02b5d945eacff708d2bf084c40044d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad02b5d945eacff708d2bf084c40044d8">&#9670;&nbsp;</a></span>generate_dragon_curve()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void generate_dragon_curve </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>state</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>iterations</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>state</em> <em>iterations</em> </p>
<p >using the "paper folding" method </p><dl class="todo"><dt><b><a class="el" href="todo.html#_todo000220">Todo:</a></b></dt><dd>find citation for paper folding method </dd></dl>

</div>
</div>
<a id="a5d43a4168ef00fcb9221321b4508c8c5" name="a5d43a4168ef00fcb9221321b4508c8c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d43a4168ef00fcb9221321b4508c8c5">&#9670;&nbsp;</a></span>greedy_algorithm()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void greedy_algorithm </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n_points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td>
          <td class="paramname"><em>bias</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p ><em>points</em> <em>n_points</em> <em>width</em> <em>bias</em> </p>
<h2><a class="anchor" id="autotoc_md44"></a>
Greedy Algorithm</h2>
<p >For each point in the list find the shortest distance to any possible neighbour, then perform a swap to make that neighbour the next item in the list.</p>
<p >To make the stitches lie more on one axis than the other bias the distance operator to prefer horizontal direction. </p>

</div>
</div>
<a id="a2f0cd5118998e9310252de0bd11c6fb2" name="a2f0cd5118998e9310252de0bd11c6fb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f0cd5118998e9310252de0bd11c6fb2">&#9670;&nbsp;</a></span>hilbert_curve()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hilbert_curve </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>iterations</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>pattern</em> <em>iterations</em> </p>
<p ><a href="https://en.wikipedia.org/wiki/Hilbert_curve">https://en.wikipedia.org/wiki/Hilbert_curve</a></p>
<p >Using the Lindenmayer System, so we can save work across different functions. </p>

</div>
</div>
<a id="a0fd47c53d468e3e5590e096495acac79" name="a0fd47c53d468e3e5590e096495acac79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0fd47c53d468e3e5590e096495acac79">&#9670;&nbsp;</a></span>join_short_stitches()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void join_short_stitches </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>n_points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>tolerence</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p ><em>points</em> <em>n_points</em> <em>width</em> <em>tolerence</em> </p>
<p >Remove points that lie in the middle of two short stitches that could be one longer stitch. Repeat until none are found. </p>

</div>
</div>
<a id="af27a83a237ef6302cbfb5af534229e10" name="af27a83a237ef6302cbfb5af534229e10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af27a83a237ef6302cbfb5af534229e10">&#9670;&nbsp;</a></span>lindenmayer_system()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int lindenmayer_system </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a914404401c03a6bf0dac814661ba370c">L_system</a>&#160;</td>
          <td class="paramname"><em>L</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>state</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>iterations</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>complete</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p ><em>L</em> <em>state</em> <em>iterations</em> <em>complete</em> </p><dl class="section return"><dt>Returns</dt><dd>int</dd></dl>
<p>This is a slow generation algorithm. </p>

</div>
</div>
<a id="af65a5f7a682322a9588066dfc9d3e10d" name="af65a5f7a682322a9588066dfc9d3e10d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af65a5f7a682322a9588066dfc9d3e10d">&#9670;&nbsp;</a></span>save_points_to_pattern()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void save_points_to_pattern </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a168c2ed6c7e17dd1aa7755aabc1db314">EmbPattern</a> *&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n_points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a2082be9aabfb541dff1825c4ca6a05cd">EmbReal</a>&#160;</td>
          <td class="paramname"><em>scale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p ><em>pattern</em> <em>points</em> <em>n_points</em> <em>scale</em> <em>width</em> <em>height</em> </p>

</div>
</div>
<a id="adc8683886c723530102d2b75f14b6dbd" name="adc8683886c723530102d2b75f14b6dbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc8683886c723530102d2b75f14b6dbd">&#9670;&nbsp;</a></span>threshold_method()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int * threshold_method </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="embroidery_8h.html#a907d23c2268eff84b7c5146b2add1bb4">EmbImage</a> *&#160;</td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>n_points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>subsample_width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>subsample_height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>threshold</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p ><em>image</em> <em>n_points</em> <em>subsample_width</em> <em>subsample_height</em> <em>threshold</em> </p><dl class="section return"><dt>Returns</dt><dd>int*</dd></dl>
<p>Identify darker pixels to put stitches in. </p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a6e10b231de6baafee918b26f004d7327" name="a6e10b231de6baafee918b26f004d7327"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e10b231de6baafee918b26f004d7327">&#9670;&nbsp;</a></span>hilbert_curve_l_system</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="embroidery_8h.html#a914404401c03a6bf0dac814661ba370c">L_system</a> hilbert_curve_l_system</td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
<div class="line">    <span class="charliteral">&#39;A&#39;</span>, <span class="stringliteral">&quot;AB&quot;</span>, <span class="stringliteral">&quot;F+-&quot;</span>, (<span class="keywordtype">char</span>**)<a class="code hl_variable" href="fill_8c.html#add6424b0861a4e44ac11fc4cbf99d1d1">rules</a></div>
<div class="line">}</div>
<div class="ttc" id="afill_8c_html_add6424b0861a4e44ac11fc4cbf99d1d1"><div class="ttname"><a href="fill_8c.html#add6424b0861a4e44ac11fc4cbf99d1d1">rules</a></div><div class="ttdeci">const char * rules[]</div><div class="ttdef"><b>Definition:</b> fill.c:20</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="add6424b0861a4e44ac11fc4cbf99d1d1" name="add6424b0861a4e44ac11fc4cbf99d1d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add6424b0861a4e44ac11fc4cbf99d1d1">&#9670;&nbsp;</a></span>rules</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* rules[] = {&quot;+BF-AFA-FB+&quot;, &quot;-AF+BFB+FA-&quot;}</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_dc9e1e299a0b26f222fe6c0a872463f0.html">extern</a></li><li class="navelem"><a class="el" href="dir_6a8aa8af2875e58e82a0145491f7a8e2.html">libembroidery</a></li><li class="navelem"><a class="el" href="dir_50a7dc5dba8160ac8332d90912e622db.html">src</a></li><li class="navelem"><a class="el" href="fill_8c.html">fill.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
  </ul>
</div>
</body>
</html>
